package com.qinggeng.project.system.service.impl;

import com.qinggeng.common.utils.DateUtils;
import com.qinggeng.project.system.domain.RiderStatistics;
import com.qinggeng.project.system.mapper.RiderStatisticsMapper;
import com.qinggeng.project.system.service.IRiderStatisticsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 骑手数据统计Service业务层处理
 *
 * @author qinggeng
 * @date 2020-06-30
 */
@Service
public class RiderStatisticsServiceImpl implements IRiderStatisticsService
{
    @Resource
    private RiderStatisticsMapper riderStatisticsMapper;

    /**
     * 查询骑手数据统计
     *
     * @param id 骑手数据统计ID
     * @return 骑手数据统计
     */
    @Override
    public RiderStatistics selectRiderStatisticsById(Long id)
    {
        return riderStatisticsMapper.selectRiderStatisticsById(id);
    }

    /**
     * 查询骑手数据统计列表
     *
     * @param riderStatistics 骑手数据统计
     * @return 骑手数据统计
     */
    @Override
    public List<RiderStatistics> selectRiderStatisticsList(RiderStatistics riderStatistics)
    {
        return riderStatisticsMapper.selectRiderStatisticsList(riderStatistics);
    }

    /**
     * 新增骑手数据统计
     *
     * @param riderStatistics 骑手数据统计
     * @return 结果
     */
    @Override
    public int insertRiderStatistics(RiderStatistics riderStatistics)
    {
        riderStatistics.setCreateTime(DateUtils.getNowDate());
        return riderStatisticsMapper.insertRiderStatistics(riderStatistics);
    }

    /**
     * 修改骑手数据统计
     *
     * @param riderStatistics 骑手数据统计
     * @return 结果
     */
    @Override
    public int updateRiderStatistics(RiderStatistics riderStatistics)
    {
        return riderStatisticsMapper.updateRiderStatistics(riderStatistics);
    }

    /**
     * 批量删除骑手数据统计
     *
     * @param ids 需要删除的骑手数据统计ID
     * @return 结果
     */
    @Override
    public int deleteRiderStatisticsByIds(Long[] ids)
    {
        return riderStatisticsMapper.deleteRiderStatisticsByIds(ids);
    }

    /**
     * 删除骑手数据统计信息
     *
     * @param id 骑手数据统计ID
     * @return 结果
     */
    @Override
    public int deleteRiderStatisticsById(Long id)
    {
        return riderStatisticsMapper.deleteRiderStatisticsById(id);
    }

    @Override
    public int batchInsertData(List<RiderStatistics> riderStatisticsList) {
       return riderStatisticsMapper.batchInsertData(riderStatisticsList);
    }
}
